<%
	response.setContentType("text/html; charset=UTF-8");
%>
<%
	//logging
	if(_pagenum!=0)
	{
		canss.webservice.service.PortalIntraWebServiceControl portalctl = null;
		portalctl = (portalctl==null)?new canss.webservice.service.PortalIntraWebServiceControlBean():portalctl;
		portalctl.addNewEvent(basic.PORTAL_MODULE_ID, basic.LOG_PORTAL_WEBPAGE_REQUEST, DBStringEncoder.getServerTime().getTime(), String.format("<log><pid>%s</pid><name>%s</name><sessionkey>%s</sessionkey><type>%s</type><pagenum>%s</pagenum></log>", _pid, _name, _sessionkey, _loginedas, _pagenum));
	}
	
	switch(_pagenum)
	{
	case 0:
		//response.sendRedirect(response.encodeRedirectURL("index.jsp?loginfailed"));
		break;
	case 1:
		locstr = "Home";
		break;
	case 2:
		locstr = "Home > List Contents";
		out.write("case2(0,10);");
		break;
	case 3:
		locstr = "Home > Edit Feeds";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTFeed.xsl", 
						DBStringEncoder.EncString("svtCPAdminFeed" + "?" + "_pid="+_pid))
				);
		break;
	case 4:
		locstr = "Home > List Contents";
		out.write("case4(0,10);");
		break;
	case 5:
		locstr = "Home > Edit Feeds";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTFeedAdmin.xsl", 
						DBStringEncoder.EncString("svtOPAdminFeed" + "?" + "_pid="+_pid))
				);
		break;
	case 6:
		locstr = "Home > Edit Event Descriptions";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTEventDescAdmin.xsl", 
						DBStringEncoder.EncString("svtOPAdminEventDesc" + "?" + "_pid="+_pid))
				);
		break;
	case 8:
		locstr = "Home > Edit Channels";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTChannel.xsl", 
						DBStringEncoder.EncString("svtTRChannel" + "?" + "_pid="+_pid))
				);
		break;
	case 9:
		locstr = "Home > Edit Feeds";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTFeedTR.xsl", 
						DBStringEncoder.EncString("svtTRAdminFeed" + "?" + "_pid="+_pid))
				);
		break;
	case 10:
		locstr = "Home > Service API Description";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTKeyDesc.xsl", 
						DBStringEncoder.EncString("svtGetKeyDesc" + "?" + "_pid="+_pid+"&_key="+_key))
				);
		break;
	case 11:
		locstr = "Home > List Contents";
		out.write("case11(0,10);");
		break;
	case 12:
		locstr = "Home";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTHomeAdmin.xsl", 
						DBStringEncoder.EncString("svtOPHome" + "?" + "_pid="+_pid))
				);
		break;
	case 13:
		locstr = "Home";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTHomeCP.xsl", 
						DBStringEncoder.EncString("svtCPHome" + "?" + "_pid="+_pid))
				);
		break;
	case 14:
		locstr = "Home";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTHomeTR.xsl", 
						DBStringEncoder.EncString("svtTRHome" + "?" + "_pid="+_pid))
				);
		break;
	case 15:
		locstr = "Home > List Contents";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTContentDescAdmin_f.xsl", 
						DBStringEncoder.EncString("svtOPAdminDesc" + "?_fastmode=1&" + "_pid="+_pid))
				);
		break;
	case 16:
		locstr = "Home > List Contents";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTContentDesc_f.xsl", 
						DBStringEncoder.EncString("svtCPAdminDesc" + "?_fastmode=1&" + "_pid="+_pid))
				);
		break;
	case 17:
		locstr = "Home > Person List";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTPersonListAdmin.xsl", 
						DBStringEncoder.EncString("svtOPAdminPerson"))
				);
		break;
	case 18:
		locstr = "Home > Edit Event Descriptions";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTEventDescTR.xsl", 
						DBStringEncoder.EncString("svtOPAdminEventDesc" + "?" + "_pid="+_pid))
				);
		break;
	case 22:
		locstr = "Home > Edit Modules";
		out.write(
				String.format(
						"docall(\"POST\", \"svtXSLT\", \"_xslpath=%s&_xmlpath=%s\");", 
						"XSLTModuleDescAdmin.xsl", 
						DBStringEncoder.EncString("svtOPMIDDesc"))
				);
		break;
	}
	out.write("$('#divloc').html('"+locstr+"');");
%>


function case2(_startfrom, _howmany, _orderby, _orderbytype, _search_opt, _search_word, _viewtype)
{
	//loading gif
  $("#divbody1").html($("#div_nowloading").html());
	$.ajax({
  type: "POST",
  url: "components/ListContents.jsp",
  data: {
  				_orderby:_orderby,
  				_orderbytype:_orderbytype,
  				_debug:'<%=_debug%>', 
  				_startfrom:_startfrom, 
  				_howmany:_howmany,
  				_viewtype:_viewtype,
  				_search_opt:_search_opt,
  				_search_word:_search_word,
  				_condition:'canssContentDescription_owner="<%=_pid%>"',
  				_func:'case2'},
  success: function(msg){
    $("#divbody1").html(msg);
    ajaxonload();
  }
  });
}
function case4(_startfrom, _howmany, _orderby, _orderbytype, _search_opt, _search_word, _viewtype)
{
	//loading gif
  $("#divbody1").html($("#div_nowloading").html());
	$.ajax({
  type: "POST",
  url: "components/ListContents.jsp",
  data: {
  				_orderby:_orderby,
  				_orderbytype:_orderbytype,
  				_debug:'<%=_debug%>', 
  				_startfrom:_startfrom, 
  				_howmany:_howmany,
  				_viewtype:_viewtype,
  				_search_opt:_search_opt,
  				_search_word:_search_word,
  				_condition:'',
  				_func:'case4'},
  success: function(msg){
    $("#divbody1").html(msg);
    ajaxonload();
  }
  });
}
function case11(_startfrom, _howmany, _orderby, _orderbytype, _search_opt, _search_word, _viewtype)
{
	//loading gif
  $("#divbody1").html($("#div_nowloading").html());
	$.ajax({
  type: "POST",
  url: "components/ListContents.jsp",
  data: {
  				_orderby:_orderby,
  				_orderbytype:_orderbytype,
  				_debug:'<%=_debug%>', 
  				_startfrom:_startfrom, 
  				_howmany:_howmany,
  				_viewtype:_viewtype,
  				_search_opt:_search_opt,
  				_search_word:_search_word,
  				_condition:'canssContentDescription_owner="<%=_pid%>"',
  				_func:'case11'},
  success: function(msg){
    $("#divbody1").html(msg);
    ajaxonload();
  }
  });
}

function ajaxonload(){}
function componload(){}